package com.platform.comm.ftp.exception;

/**
 *  ftp异常
 */
public class FtpException extends RuntimeException {

    private ErrorCode errorCode;

    public FtpException(ErrorCode errorCode) {
        super(errorCode.getDesc());
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public enum ErrorCode{
        LOGIN_ERROR("01","FTP服务器登录失败"),
        FILE_NOT_FOUND("02","FTP服务器未找到对应文件"),
        DOWNLOAD_FAILED("03","FTP服务器下载文件失败"),
        UPLOAD_FAILED("04","FTP服务器上传文件失败"),
        DELETE_FAILED("05","FTP服务器删除文件失败");

        private String code;

        private String desc;

        ErrorCode(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }


}
